package com.atguigu.gmallsugar.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface KwMapper {
    @Select("select  keyword,sum(multiIf(source='search',10,source='click',8,source='order',5,2)) score " +
        "from keyword_stats_2021 where toYYYYMMDD(stt)=#{date} " +
        "group by keyword order by score desc limit #{limit};\n")
    List<Map<String, Object>> kw(@Param(value = "date") int date, @Param(value = "limit") int limit);
}
